From: Andrew Cooper Date: Fri, 17 Jul 2015 16:59:09 +0000 (+0100) Subject: tools/libxl: Initialise the fd of the unused half of a datacopier X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~2754 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=21d9b079e538;p=xen.git tools/libxl: Initialise the fd of the unused half of a datacopier This bug causes a spurious failure if stdin happens to be an appropriately readable/writeable pipe which receives a POLLHUP Signed-off-by: Andrew Cooper CC: Ian Campbell CC: Ian Jackson CC: Wei Liu Acked-by: Wei Liu Acked-by: Ian Campbell --- diff --git a/tools/libxl/libxl_stream_read.c b/tools/libxl/libxl_stream_read.c index 2d17403e44..0535e7f21f 100644 --- a/tools/libxl/libxl_stream_read.c +++ b/tools/libxl/libxl_stream_read.c @@ -609,6 +609,7 @@ static void write_emulator_blob(libxl__egc *egc, dc->ao = stream->ao; dc->writewhat = "qemu save file"; dc->writefd = writefd; + dc->readfd = -1; dc->maxsz = -1; dc->callback = write_emulator_done; diff --git a/tools/libxl/libxl_stream_write.c b/tools/libxl/libxl_stream_write.c index 944a87b990..96b9b07f27 100644 --- a/tools/libxl/libxl_stream_write.c +++ b/tools/libxl/libxl_stream_write.c @@ -387,6 +387,7 @@ static void write_emulator_record(libxl__egc *egc, dc->ao = stream->ao; dc->readwhat = "qemu save file"; dc->readfd = readfd; + dc->writefd = -1; dc->maxsz = -1; dc->readbuf = stream->emu_body + sizeof(*ehdr); dc->bytes_to_read = rec->length - sizeof(*ehdr);